Zend/COW invariant violation around $_FILES in debug-assertion builds #21160
+3
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
rfc1867_post_handler()registers file metadata into&PG(http_globals)[TRACK_VARS_FILES](i.e.$_FILES). See main/rfc1867.c:1153.$_FILESis created as an auto-global and inserted intoEG(symbol_table)inphp_auto_globals_create_files()(main/php_variables.c). That means the underlyingHashTableends up withrefcount > 1.When
php_register_variable_*()tries to write into that sharedHashTable, Zend asserts in Zend/zend_hash.c:912 unless the table is markedHT_ALLOW_COW_VIOLATION(same mechanism already used for$_SERVER).